package cn.jinjimi.base.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 *
 * @author zhenhua
 * @date 2018/2/7
 */

public class TimeUtils {

    public static final String TIME_YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
    public static final String TIME_YYYY_MM_DD = "yyyy-MM-dd";

    public static String format(String pattern, long time) {
        SimpleDateFormat format=new SimpleDateFormat(pattern, Locale.getDefault());
        return format.format(new Date(time));
    }
}
